package fr.afcepf.atod16.groupe1.projet1.dto.util;

import javax.xml.bind.annotation.XmlElement;

/**
 * Le DTO maj stock (pour webservice)
 * @author cedric
 */
public class DtoMajStock {

    private String codeEAN13;
    private Integer stock;

    public DtoMajStock() {
    }

    public DtoMajStock(String codeEAN13, Integer stock) {
        this.codeEAN13 = codeEAN13;
        this.stock = stock;
    }

    @XmlElement(required = true)
    public String getCodeEAN13() {
        return codeEAN13;
    }

    public void setCodeEAN13(String codeEAN13) {
        this.codeEAN13 = codeEAN13;
    }

    @XmlElement(required = true)
    public Integer getStock() {
        return stock;
    }

    public void setStock(Integer stock) {
        this.stock = stock;
    }

    @Override
    public String toString() {
        return "DtoMajStock{" + "codeEAN13=" + codeEAN13 + ", stock=" + stock + '}';
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 97 * hash + (this.codeEAN13 != null ? this.codeEAN13.hashCode() : 0);
        hash = 97 * hash + (this.stock != null ? this.stock.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final DtoMajStock other = (DtoMajStock) obj;
        if ((this.codeEAN13 == null) ? (other.codeEAN13 != null) : !this.codeEAN13.equals(other.codeEAN13)) {
            return false;
        }
        if (this.stock != other.stock && (this.stock == null || !this.stock.equals(other.stock))) {
            return false;
        }
        return true;
    }
}
